#include<stdio.h>
int factorial(int n);
int main()
{   int number,sub;
	scanf("%d",&number);
	sub=factorial(number);
	printf("%d",sub);
	return 0;
}
int factorial(int n)
{
	int i,s=1,h=1,m;
	for(i=1;i<=n;i++)
	{
		s=s*i;
		h=h*i;
	}
	m=s*h;
	if(n>1)
	return m+factorial(n-1);
	else
	return 1;
}
